﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web;

namespace FFIV.Lib.Utilities
{
	public class ParamUtility
	{
		public static int GetQueryStringValue(string QueryName, int nullValue)
		{
			if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString[QueryName]))
			{
				return nullValue;
			}
			return Convert.ToInt32(HttpContext.Current.Request.QueryString[QueryName]);
		}

		public static string GetQueryStringValue(string QueryName, string nullValue)
		{
			if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString[QueryName]))
			{
				return nullValue;
			}
			return HttpContext.Current.Request.QueryString[QueryName];
		}

		public static bool GetQueryStringValue(string QueryName, bool nullValue)
		{
			if (string.IsNullOrEmpty(HttpContext.Current.Request.QueryString[QueryName]))
			{
				return nullValue;
			}
			return Convert.ToBoolean(HttpContext.Current.Request.QueryString[QueryName]);
		}
	}
}
